/*
 *  touchHell.h
 *  touchhell
 *
 *  Created by omega on 08/12/22.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */

#import "Texture2D.h"

// テクスチャ
void Hell_loadTextureFromFile( int tex_idx , char* filename );
void Hell_drawFontWithTexture( char* str , TextureFontParam fontparam );
void Hell_drawFontWithTextureColor( char* str, TextureFontParam fontparam , int r , int g , int b , int a );
void Hell_drawTexture( int tex_idx , float tx , float ty , float tw , float th );
void Hell_drawTextureColor( int tex_idx , float tx , float ty , float tw , float th , int r , int g , int b , int a);
void Hell_bindTexture( int tex_idx );

// レンダリングステート
typedef enum{
	HELL_ALPHABLEND_NORMAL = 0,
	HELL_ALPHABLEND_ADD ,
} Hell_AlphaBlendMode;

void Hell_setAlphaBlendMode( Hell_AlphaBlendMode mode );

// 加速度センサ
float Hell_getAccelerometerX();
float Hell_getAccelerometerY();
float Hell_getAccelerometerZ();

// タッチイベント
typedef enum{
	HELL_TOUCHPHASE_BEGAN		= UITouchPhaseBegan ,
	HELL_TOUCHPHASE_MOVED		= UITouchPhaseMoved ,
	HELL_TOUCHPHASE_ENDED		= UITouchPhaseEnded ,
	HELL_TOUCHPHASE_CANCELLED	= UITouchPhaseCancelled ,
} Hell_TouchPhase;

typedef struct{
	float x,y;
	float prev_x,prev_y;
	Hell_TouchPhase phase;
	int tapCount;
} Hell_TouchEvent;

// 効果音
void Hell_loadSoundEffectFromFile( int snd_idx , char* filename );
void Hell_playSoundEffect( int snd_idx );
void Hell_loadBgm( char* filename );
void Hell_playBgm();
void Hell_stopBgm();
void Hell_setBgmVolume( float volume );

// デバッグ
void Hell_logwrite( char* str );

// NSUserDefaults
bool Hell_saveBytes( char* str , void* bytes , size_t size );
bool Hell_loadBytes( char* str , void* bytes , size_t size );
bool Hell_synchronize();